<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateInformationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('information', function (Blueprint $table) {
            $table->id();
            $table->string('merchant_name')->comment('商户名称');
            $table->string('merchant_type')->nullable()->comment('商户类别');
            $table->string('merchant_district')->nullable()->comment('所属商圈');
            $table->string('merchant_preview')->nullable()->comment('缩略图');
            $table->json('merchant_poster')->nullable()->comment('商户海报');
            $table->text('merchant_introduce')->nullable()->comment('商户介绍');
            $table->text('merchant_education')->nullable()->comment('商户文化');
            $table->string('merchant_phone')->nullable()->comment('商户联系电话');
            $table->string('merchant_address')->nullable()->comment('商户地址');
            $table->json('merchant_latitudeAndLongitude')->nullable()->comment('经纬度');
            $table->foreignId('user_id')->constrained()->onDelete('cascade');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('information');
    }
}
